home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4417 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.3 KB  |  52 lines

  1. Path: isar.de!news
  2. From: Gerson Kurz <dekonstruktor@pergamon.isar.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Life is strange, especially with Watcom
  5. Date: Tue, 30 Jan 1996 09:27:17 +0100
  6. Organization: Pergamon Sued GmbH
  7. Message-ID: <310DD665.1468@pergamon.isar.de>
  8. References: <DLxtH3.AMA.0.-s@cs.vu.nl>
  9. NNTP-Posting-Host: diskursplateau.pergamon.isar.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b4 (WinNT; I)
  14.  
  15. Andre Versteeg wrote:
  16. > I have trouble with the difference between C and C++ with Watcom 10.0:
  17. > ---
  18. > I have a library with the following function in the .H header file:
  19. > int Setup(void)
  20. > With this library came a .C example file which used this function as follows:
  21. > int v;
  22. > v = Setup();
  23. > All compiles very well, until I changed the code to:
  24. > int v = Setup(); and changed the filename to .CPP
  25. > Now the compiler screams the following:
  26. > * Undefined reference: int near Setup(void)
  27. > ----
  28. > My question is (easy to guess):
  29. > How can I change my code, so that the compiler generates it correctly ?
  30. > I'm compiling with DOS4GW in Protected Mode.
  31. > Can somebody offer a solution ? I'm not allowed to change the library...
  32.  
  33. wrap your include in a <extern "C"> sequence
  34.  
  35. extern "C" {
  36. #include something.h
  37. }
  38.